Developer --> Technical Publications
PATHHardware Documentation > USB Devices > Mac OS USB DDK API Reference


USBClosePipeByReference

The USBClosePipeByReference function closes the specified pipe currently opened. The pipe reference is deleted and no further reference can be made to it. All outstanding transactions on the specified pipe are returned with a kUSBAborted status.

OSStatus USBClosePipeByReference(USBPipeRef ref);

--> ref
Pipe reference for the pipe to close

The USBClosePipeByReference function is similar to the pipe state control functions described later in this document. This function does not require a parameter block and does not complete asynchronously.

See also the USBFindNextPipe and USBOpenPipe functions.

The errors returned by the USBClosePipeByReference function include:

kUSBUnknownPipeErr
-6997 pipe reference not recognized

The kUSBPipeStalledErr and kUSBPipeIdleErr are also returned if the pipe is not currently active. In this instance, the call has failed and the pipe will have to be activated again before it can be closed. This behavior will be changed to return noErr and succeed in a later release of the USB software.

kUSBPipeStalledErr
-6979 pipe is stalled, pipe not closed
kUSBPipeIdleErr
-6980 pipe is idle, pipe not closed

© 1999 Apple Computer, Inc.

Previous | Back Up One Level | Next | Show Frames | Hide Frames